/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'eais.aliyuncs.com',
    'ap-northeast-2-pop' = 'eais.aliyuncs.com',
    'ap-south-1' = 'eais.aliyuncs.com',
    'ap-southeast-1' = 'eais.aliyuncs.com',
    'ap-southeast-2' = 'eais.aliyuncs.com',
    'ap-southeast-3' = 'eais.aliyuncs.com',
    'ap-southeast-5' = 'eais.aliyuncs.com',
    'cn-beijing-finance-1' = 'eais.aliyuncs.com',
    'cn-beijing-finance-pop' = 'eais.aliyuncs.com',
    'cn-beijing-gov-1' = 'eais.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'eais.aliyuncs.com',
    'cn-edge-1' = 'eais.aliyuncs.com',
    'cn-fujian' = 'eais.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'eais.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'eais.aliyuncs.com',
    'cn-hangzhou-finance' = 'eais.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'eais.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'eais.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'eais.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'eais.aliyuncs.com',
    'cn-hangzhou-test-306' = 'eais.aliyuncs.com',
    'cn-hongkong' = 'eais.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'eais.aliyuncs.com',
    'cn-huhehaote' = 'eais.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'eais.aliyuncs.com',
    'cn-north-2-gov-1' = 'eais.aliyuncs.com',
    'cn-qingdao' = 'eais.aliyuncs.com',
    'cn-qingdao-nebula' = 'eais.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'eais.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'eais.aliyuncs.com',
    'cn-shanghai-finance-1' = 'eais.aliyuncs.com',
    'cn-shanghai-inner' = 'eais.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'eais.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'eais.aliyuncs.com',
    'cn-shenzhen-inner' = 'eais.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'eais.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'eais.aliyuncs.com',
    'cn-wuhan' = 'eais.aliyuncs.com',
    'cn-wulanchabu' = 'eais.aliyuncs.com',
    'cn-yushanfang' = 'eais.aliyuncs.com',
    'cn-zhangbei' = 'eais.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'eais.aliyuncs.com',
    'cn-zhangjiakou' = 'eais.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'eais.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'eais.aliyuncs.com',
    'eu-central-1' = 'eais.aliyuncs.com',
    'eu-west-1' = 'eais.aliyuncs.com',
    'eu-west-1-oxs' = 'eais.aliyuncs.com',
    'me-east-1' = 'eais.aliyuncs.com',
    'rus-west-1-pop' = 'eais.aliyuncs.com',
    'us-east-1' = 'eais.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('eais', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AttachEaiRequest {
  clientInstanceId?: string(name='ClientInstanceId', description='This parameter is required.', example='i-wz93g6pyat2g7t7o****'),
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', description='This parameter is required.', example='eais-sz8t15a7gt7z7j7i****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
}

model AttachEaiResponseBody = {
  clientInstanceId?: string(name='ClientInstanceId', example='i-wz93g6pyat2g7t7o****'),
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', example='eais-sz8t15a7gt7z7j7i****'),
  requestId?: string(name='RequestId', example='C3BCB7DA-BEB6-4982-A765-6EA61EC84474'),
}

model AttachEaiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachEaiResponseBody(name='body'),
}

/**
 * @summary 将弹性加速计算实例挂载到ECS实例上
 *
 * @param request AttachEaiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachEaiResponse
 */
async function attachEaiWithOptions(request: AttachEaiRequest, runtime: $RuntimeOptions): AttachEaiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientInstanceId)) {
    query['ClientInstanceId'] = request.clientInstanceId;
  }
  if (!$isNull(request.elasticAcceleratedInstanceId)) {
    query['ElasticAcceleratedInstanceId'] = request.elasticAcceleratedInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AttachEai',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 将弹性加速计算实例挂载到ECS实例上
 *
 * @param request AttachEaiRequest
 * @return AttachEaiResponse
 */
async function attachEai(request: AttachEaiRequest): AttachEaiResponse {
  var runtime = new $RuntimeOptions{};
  return attachEaiWithOptions(request, runtime);
}

model AttachEaisEiRequest {
  clientInstanceId?: string(name='ClientInstanceId', description='This parameter is required.', example='i-bp14ws9hbt1oe0u9****'),
  eiInstanceId?: string(name='EiInstanceId', example='eais-hzu00xufs1c8j5nn****'),
  eiInstanceType?: string(name='EiInstanceType', example='eais.ei-a6.2xlarge'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model AttachEaisEiResponseBody = {
  clientInstanceId?: string(name='ClientInstanceId', example='i-bp14ws9hbt1oe0u9****'),
  eiInstanceId?: string(name='EiInstanceId', example='eais-hzu00xufs1c8j5nn****'),
  requestId?: string(name='RequestId', example='C3BCB7DA-BEB6-4982-A765-6EA61EC8****'),
}

model AttachEaisEiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachEaisEiResponseBody(name='body'),
}

/**
 * @summary 将EI绑定到ECS或ECI实例上
 *
 * @param request AttachEaisEiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachEaisEiResponse
 */
async function attachEaisEiWithOptions(request: AttachEaisEiRequest, runtime: $RuntimeOptions): AttachEaisEiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientInstanceId)) {
    query['ClientInstanceId'] = request.clientInstanceId;
  }
  if (!$isNull(request.eiInstanceId)) {
    query['EiInstanceId'] = request.eiInstanceId;
  }
  if (!$isNull(request.eiInstanceType)) {
    query['EiInstanceType'] = request.eiInstanceType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AttachEaisEi',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 将EI绑定到ECS或ECI实例上
 *
 * @param request AttachEaisEiRequest
 * @return AttachEaisEiResponse
 */
async function attachEaisEi(request: AttachEaisEiRequest): AttachEaisEiResponse {
  var runtime = new $RuntimeOptions{};
  return attachEaisEiWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  resourceGroupId?: string(name='ResourceGroupId', description='This parameter is required.', example='rg-acfmvpuy4a5****'),
  resourceId?: string(name='ResourceId', description='This parameter is required.', example='eais-hzs4h26yyt5xkcke****'),
  resourceRegionId?: string(name='ResourceRegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', example='C3BCB7DA-BEB6-4982-A765-6EA61EC8****'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary 资源转组
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: $RuntimeOptions): ChangeResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceRegionId)) {
    query['ResourceRegionId'] = request.resourceRegionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeResourceGroup',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 资源转组
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CreateEaiRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  image?: string(name='Image'),
  instanceName?: string(name='InstanceName', example='eais-test01'),
  instanceType?: string(name='InstanceType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
  resourceGroupId?: string(name='ResourceGroupId'),
  securityGroupId?: string(name='SecurityGroupId', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiResponseBody = {
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', example='eais-sz8t15a7gt7z7j7i****'),
  requestId?: string(name='RequestId', example='A655AB0E-31BB-45AD-9255-FCE93F6*****'),
}

model CreateEaiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEaiResponseBody(name='body'),
}

/**
 * @summary 创建一个弹性加速计算实例
 *
 * @param request CreateEaiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEaiResponse
 */
async function createEaiWithOptions(request: CreateEaiRequest, runtime: $RuntimeOptions): CreateEaiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.image)) {
    query['Image'] = request.image;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateEai',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个弹性加速计算实例
 *
 * @param request CreateEaiRequest
 * @return CreateEaiResponse
 */
async function createEai(request: CreateEaiRequest): CreateEaiResponse {
  var runtime = new $RuntimeOptions{};
  return createEaiWithOptions(request, runtime);
}

model CreateEaiEciRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  eaisName?: string(name='EaisName', example='eais-test01'),
  eaisType?: string(name='EaisType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  eci?: {
    container?: {
      arg?: string(name='Arg', example='100'),
      command?: string(name='Command', example='sleep'),
      image?: string(name='Image', example='nginx'),
      name?: string(name='Name', example='test1'),
      volumes?: string(name='Volumes', example='/mnt/eais=eais,/models=eais/models'),
    }(name='Container'),
    eipId?: string(name='EipId', example='eip-uf66jeqopgqa9hdn****'),
    name?: string(name='Name', example='test-nginx'),
    type?: string(name='Type', example='ecs.c5.xlarge'),
    volume?: string(name='Volume', example='00c7****-rivj.cn-hangzhou.extreme.nas.aliyuncs.com:/share'),
  }(name='Eci'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmvpuy4a5****'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiEciShrinkRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  eaisName?: string(name='EaisName', example='eais-test01'),
  eaisType?: string(name='EaisType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  eciShrink?: string(name='Eci'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmvpuy4a5****'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiEciResponseBody = {
  clientInstanceId?: string(name='ClientInstanceId', example='eci-2zeh03ygxlrzmfi6****'),
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', example='eais-sz8t15a7gt7z7j7i****'),
  requestId?: string(name='RequestId', example='F5FEB9AA-C108-577C-AB3D-D13524AF****'),
}

model CreateEaiEciResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEaiEciResponseBody(name='body'),
}

/**
 * @summary 创建一个EAIS实例和ECI实例并绑定
 *
 * @param tmpReq CreateEaiEciRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEaiEciResponse
 */
async function createEaiEciWithOptions(tmpReq: CreateEaiEciRequest, runtime: $RuntimeOptions): CreateEaiEciResponse {
  tmpReq.validate();
  var request = new CreateEaiEciShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.eci)) {
    request.eciShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.eci, 'Eci', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.eaisName)) {
    query['EaisName'] = request.eaisName;
  }
  if (!$isNull(request.eaisType)) {
    query['EaisType'] = request.eaisType;
  }
  if (!$isNull(request.eciShrink)) {
    query['Eci'] = request.eciShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateEaiEci',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个EAIS实例和ECI实例并绑定
 *
 * @param request CreateEaiEciRequest
 * @return CreateEaiEciResponse
 */
async function createEaiEci(request: CreateEaiEciRequest): CreateEaiEciResponse {
  var runtime = new $RuntimeOptions{};
  return createEaiEciWithOptions(request, runtime);
}

model CreateEaiEcsRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  eaisName?: string(name='EaisName', example='eais-test01'),
  eaisType?: string(name='EaisType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  ecs?: {
    imageId?: string(name='ImageId', example='aliyun_2_1903_x64_20G_alibase_20200324.vhd'),
    internetMaxBandwidthIn?: string(name='InternetMaxBandwidthIn', example='10'),
    internetMaxBandwidthOut?: string(name='InternetMaxBandwidthOut', example='10'),
    name?: string(name='Name', example='test1'),
    password?: string(name='Password', example='EcsV587!'),
    systemDiskCategory?: string(name='SystemDiskCategory', example='cloud_ssd'),
    systemDiskSize?: long(name='SystemDiskSize', example='40'),
    type?: string(name='Type', example='ecs.g7.4xlarge'),
    zoneId?: string(name='ZoneId', example='cn-shenzhen-e'),
  }(name='Ecs'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmvpuy4a5****'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiEcsShrinkRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  eaisName?: string(name='EaisName', example='eais-test01'),
  eaisType?: string(name='EaisType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  ecsShrink?: string(name='Ecs'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmvpuy4a5****'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiEcsResponseBody = {
  clientInstanceId?: string(name='ClientInstanceId', example='i-bp1hjrvleawl4ogb****'),
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', example='eais-sz8t15a7gt7z7j7i****'),
  requestId?: string(name='RequestId', example='F5FEB9AA-C108-577C-AB3D-D13524AF****'),
}

model CreateEaiEcsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEaiEcsResponseBody(name='body'),
}

/**
 * @summary 创建一个EAIS实例和ECS实例并绑定
 *
 * @param tmpReq CreateEaiEcsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEaiEcsResponse
 */
async function createEaiEcsWithOptions(tmpReq: CreateEaiEcsRequest, runtime: $RuntimeOptions): CreateEaiEcsResponse {
  tmpReq.validate();
  var request = new CreateEaiEcsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.ecs)) {
    request.ecsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ecs, 'Ecs', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.eaisName)) {
    query['EaisName'] = request.eaisName;
  }
  if (!$isNull(request.eaisType)) {
    query['EaisType'] = request.eaisType;
  }
  if (!$isNull(request.ecsShrink)) {
    query['Ecs'] = request.ecsShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateEaiEcs',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个EAIS实例和ECS实例并绑定
 *
 * @param request CreateEaiEcsRequest
 * @return CreateEaiEcsResponse
 */
async function createEaiEcs(request: CreateEaiEcsRequest): CreateEaiEcsResponse {
  var runtime = new $RuntimeOptions{};
  return createEaiEcsWithOptions(request, runtime);
}

model CreateEaiJupyterRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  eaisName?: string(name='EaisName'),
  eaisType?: string(name='EaisType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  environmentVar?: [ 
    {
      key?: string(name='Key', example='MY_USER_NAME'),
      value?: string(name='Value', example='test123'),
    }
  ](name='EnvironmentVar'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiJupyterShrinkRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  eaisName?: string(name='EaisName'),
  eaisType?: string(name='EaisType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  environmentVarShrink?: string(name='EnvironmentVar'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-uf66jeqopgqa9hdn****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-uf6h3rbwbm90urjwa****'),
}

model CreateEaiJupyterResponseBody = {
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', example='eais-hz8t15a7gt7z7j7i****'),
  requestId?: string(name='RequestId', example='A655AB0E-31BB-45AD-9255-FCE93F6*****'),
}

model CreateEaiJupyterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEaiJupyterResponseBody(name='body'),
}

/**
 * @summary 创建一个EAIS Jupyter环境
 *
 * @param tmpReq CreateEaiJupyterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEaiJupyterResponse
 */
async function createEaiJupyterWithOptions(tmpReq: CreateEaiJupyterRequest, runtime: $RuntimeOptions): CreateEaiJupyterResponse {
  tmpReq.validate();
  var request = new CreateEaiJupyterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.environmentVar)) {
    request.environmentVarShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.environmentVar, 'EnvironmentVar', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.eaisName)) {
    query['EaisName'] = request.eaisName;
  }
  if (!$isNull(request.eaisType)) {
    query['EaisType'] = request.eaisType;
  }
  if (!$isNull(request.environmentVarShrink)) {
    query['EnvironmentVar'] = request.environmentVarShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateEaiJupyter',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个EAIS Jupyter环境
 *
 * @param request CreateEaiJupyterRequest
 * @return CreateEaiJupyterResponse
 */
async function createEaiJupyter(request: CreateEaiJupyterRequest): CreateEaiJupyterResponse {
  var runtime = new $RuntimeOptions{};
  return createEaiJupyterWithOptions(request, runtime);
}

model CreateEaisEiRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  instanceName?: string(name='InstanceName', example='test_ei'),
  instanceType?: string(name='InstanceType', description='This parameter is required.', example='eais.ei-a6.2xlarge'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmvpuy4a5****'),
  securityGroupId?: string(name='SecurityGroupId', description='This parameter is required.', example='sg-bp16jgp51ttnkbdr****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-bp17wmd1wb6fwlimk****'),
}

model CreateEaisEiResponseBody = {
  eiInstanceId?: string(name='EiInstanceId', example='eais-hzu00xufs1c8j5nn****'),
  requestId?: string(name='RequestId', example='F5FEB9AA-C108-577C-AB3D-D13524AF****'),
}

model CreateEaisEiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEaisEiResponseBody(name='body'),
}

/**
 * @summary 创建一个弹性加速计算实例
 *
 * @param request CreateEaisEiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEaisEiResponse
 */
async function createEaisEiWithOptions(request: CreateEaisEiRequest, runtime: $RuntimeOptions): CreateEaisEiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateEaisEi',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个弹性加速计算实例
 *
 * @param request CreateEaisEiRequest
 * @return CreateEaisEiResponse
 */
async function createEaisEi(request: CreateEaisEiRequest): CreateEaisEiResponse {
  var runtime = new $RuntimeOptions{};
  return createEaisEiWithOptions(request, runtime);
}

model DeleteEaiRequest {
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', description='This parameter is required.', example='eais-sz8t15a7gt7z7j7i****'),
  force?: boolean(name='Force', example='false'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
}

model DeleteEaiResponseBody = {
  requestId?: string(name='RequestId', example='F23AEEC7-4D98-4657-A104-0269270*****'),
}

model DeleteEaiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEaiResponseBody(name='body'),
}

/**
 * @summary 释放一个弹性加速计算实例
 *
 * @param request DeleteEaiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEaiResponse
 */
async function deleteEaiWithOptions(request: DeleteEaiRequest, runtime: $RuntimeOptions): DeleteEaiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.elasticAcceleratedInstanceId)) {
    query['ElasticAcceleratedInstanceId'] = request.elasticAcceleratedInstanceId;
  }
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteEai',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 释放一个弹性加速计算实例
 *
 * @param request DeleteEaiRequest
 * @return DeleteEaiResponse
 */
async function deleteEai(request: DeleteEaiRequest): DeleteEaiResponse {
  var runtime = new $RuntimeOptions{};
  return deleteEaiWithOptions(request, runtime);
}

model DeleteEaiAllRequest {
  clientInstanceId?: string(name='ClientInstanceId', example='i-bp1fvhi60e1zizsp****'),
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', description='This parameter is required.', example='eais-hza1ahi0uuw0re33****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
}

model DeleteEaiAllResponseBody = {
  requestId?: string(name='RequestId', example='AD4EA714-A35B-4710-BF92-8275BCDDB69F'),
}

model DeleteEaiAllResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEaiAllResponseBody(name='body'),
}

/**
 * @summary 释放一个弹性加速计算实例以及与其绑定的ECS或ECI实例
 *
 * @param request DeleteEaiAllRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEaiAllResponse
 */
async function deleteEaiAllWithOptions(request: DeleteEaiAllRequest, runtime: $RuntimeOptions): DeleteEaiAllResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientInstanceId)) {
    query['ClientInstanceId'] = request.clientInstanceId;
  }
  if (!$isNull(request.elasticAcceleratedInstanceId)) {
    query['ElasticAcceleratedInstanceId'] = request.elasticAcceleratedInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteEaiAll',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 释放一个弹性加速计算实例以及与其绑定的ECS或ECI实例
 *
 * @param request DeleteEaiAllRequest
 * @return DeleteEaiAllResponse
 */
async function deleteEaiAll(request: DeleteEaiAllRequest): DeleteEaiAllResponse {
  var runtime = new $RuntimeOptions{};
  return deleteEaiAllWithOptions(request, runtime);
}

model DeleteEaisEiRequest {
  eiInstanceId?: string(name='EiInstanceId', description='This parameter is required.', example='eais-hzu00xufs1c8j5nn****'),
  force?: boolean(name='Force', example='false'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DeleteEaisEiResponseBody = {
  requestId?: string(name='RequestId', example='F23AEEC7-4D98-4657-A104-02692701****'),
}

model DeleteEaisEiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEaisEiResponseBody(name='body'),
}

/**
 * @summary 释放弹性加速计算实例
 *
 * @param request DeleteEaisEiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEaisEiResponse
 */
async function deleteEaisEiWithOptions(request: DeleteEaisEiRequest, runtime: $RuntimeOptions): DeleteEaisEiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.eiInstanceId)) {
    query['EiInstanceId'] = request.eiInstanceId;
  }
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteEaisEi',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 释放弹性加速计算实例
 *
 * @param request DeleteEaisEiRequest
 * @return DeleteEaisEiResponse
 */
async function deleteEaisEi(request: DeleteEaisEiRequest): DeleteEaisEiResponse {
  var runtime = new $RuntimeOptions{};
  return deleteEaisEiWithOptions(request, runtime);
}

model DescribeEaisRequest {
  clientInstanceId?: string(name='ClientInstanceId'),
  elasticAcceleratedInstanceIds?: string(name='ElasticAcceleratedInstanceIds', example='["eais-id1", "eais-id2"]'),
  instanceName?: string(name='InstanceName', example='eais*'),
  instanceType?: string(name='InstanceType', example='eais.ei-a6.2xlarge'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='200'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
  resourceGroupId?: string(name='ResourceGroupId'),
  status?: string(name='Status', example='InUse'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model DescribeEaisResponseBody = {
  instances?: {
    instance?: [ 
    {
      category?: string(name='Category', example='jupyter'),
      clientInstanceId?: string(name='ClientInstanceId', example='i-wz93g6pyat2g****'),
      clientInstanceName?: string(name='ClientInstanceName', example='test1'),
      clientInstanceType?: string(name='ClientInstanceType', example='ecs.g5ne.large'),
      creationTime?: string(name='CreationTime', example='2020-11-11T03:11Z'),
      description?: string(name='Description', example='testDescription'),
      elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', example='eais-sz8t15a7gt7****'),
      instanceName?: string(name='InstanceName', example='testName'),
      instanceType?: string(name='InstanceType', example='eais.ei-a6.2xlarge'),
      jupyterUrl?: string(name='JupyterUrl', example='http://121.41.**.24:8888'),
      paymentType?: string(name='PaymentType'),
      regionId?: string(name='RegionId', example='cn-shenzhen'),
      resourceGroupId?: string(name='ResourceGroupId'),
      securityGroupId?: string(name='SecurityGroupId', example='sg-bp1gppir818lx4******'),
      startTime?: string(name='StartTime'),
      status?: string(name='Status', example='InUse'),
      tags?: {
        tag?: [ 
        {
          tagKey?: string(name='TagKey', example='TestKey'),
          tagValue?: string(name='TagValue', example='TestValue'),
        }
      ](name='Tag')
      }(name='Tags'),
      vSwitchId?: string(name='VSwitchId', example='vsw-bp1sd131hfmd76r******'),
      zoneId?: string(name='ZoneId', example='cn-shenzhen-e'),
    }
  ](name='Instance')
  }(name='Instances'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='1E23D585-BBD8-436F-9615-54CACD6*****'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeEaisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEaisResponseBody(name='body'),
}

/**
 * @summary 查询一个或多个弹性加速计算实例的详细信息
 *
 * @param request DescribeEaisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEaisResponse
 */
async function describeEaisWithOptions(request: DescribeEaisRequest, runtime: $RuntimeOptions): DescribeEaisResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientInstanceId)) {
    query['ClientInstanceId'] = request.clientInstanceId;
  }
  if (!$isNull(request.elasticAcceleratedInstanceIds)) {
    query['ElasticAcceleratedInstanceIds'] = request.elasticAcceleratedInstanceIds;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEais',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询一个或多个弹性加速计算实例的详细信息
 *
 * @param request DescribeEaisRequest
 * @return DescribeEaisResponse
 */
async function describeEais(request: DescribeEaisRequest): DescribeEaisResponse {
  var runtime = new $RuntimeOptions{};
  return describeEaisWithOptions(request, runtime);
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName'),
      regionEndpoint?: string(name='RegionEndpoint', example='eais.cn-shenzhen.aliyuncs.com'),
      regionId?: string(name='RegionId', example='cn-shenzhen'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId', example='F5FEB9AA-C108-577C-AB3D-D13524AF1840'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary 查询您可以使用的阿里云地域
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(runtime: $RuntimeOptions): DescribeRegionsResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询您可以使用的阿里云地域
 *
 * @return DescribeRegionsResponse
 */
async function describeRegions(): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRegionsWithOptions(runtime);
}

model DetachEaiRequest {
  elasticAcceleratedInstanceId?: string(name='ElasticAcceleratedInstanceId', description='This parameter is required.', example='eais-sz8t15a7gt7z7j7i****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-shenzhen'),
}

model DetachEaiResponseBody = {
  requestId?: string(name='RequestId', example='04DEB304-2436-4CB9-BB63-468BCEA03D9D'),
}

model DetachEaiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachEaiResponseBody(name='body'),
}

/**
 * @summary 从ECS实例上卸载弹性加速计算实例
 *
 * @param request DetachEaiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachEaiResponse
 */
async function detachEaiWithOptions(request: DetachEaiRequest, runtime: $RuntimeOptions): DetachEaiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.elasticAcceleratedInstanceId)) {
    query['ElasticAcceleratedInstanceId'] = request.elasticAcceleratedInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetachEai',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 从ECS实例上卸载弹性加速计算实例
 *
 * @param request DetachEaiRequest
 * @return DetachEaiResponse
 */
async function detachEai(request: DetachEaiRequest): DetachEaiResponse {
  var runtime = new $RuntimeOptions{};
  return detachEaiWithOptions(request, runtime);
}

model DetachEaisEiRequest {
  eiInstanceId?: string(name='EiInstanceId', description='This parameter is required.', example='eais-hzu00xufs1c8j5nn****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DetachEaisEiResponseBody = {
  requestId?: string(name='RequestId', example='04DEB304-2436-4CB9-BB63-468BCEA0****'),
}

model DetachEaisEiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachEaisEiResponseBody(name='body'),
}

/**
 * @summary 将EI实例与ECS或ECI实例解绑
 *
 * @param request DetachEaisEiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachEaisEiResponse
 */
async function detachEaisEiWithOptions(request: DetachEaisEiRequest, runtime: $RuntimeOptions): DetachEaisEiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.eiInstanceId)) {
    query['EiInstanceId'] = request.eiInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetachEaisEi',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 将EI实例与ECS或ECI实例解绑
 *
 * @param request DetachEaisEiRequest
 * @return DetachEaisEiResponse
 */
async function detachEaisEi(request: DetachEaisEiRequest): DetachEaisEiResponse {
  var runtime = new $RuntimeOptions{};
  return detachEaisEiWithOptions(request, runtime);
}

model GetInstanceMetricsRequest {
  endTime?: string(name='EndTime', example='2022-11-22T16:30:00Z'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='eais-hznzre6ffmz9num4****'),
  metricType?: string(name='MetricType', description='This parameter is required.', example='MemoryUsage'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', example='2022-11-22T16:00:00Z'),
  timeStep?: string(name='TimeStep', example='5m'),
}

model GetInstanceMetricsResponseBody = {
  instanceId?: string(name='InstanceId', example='eais-bj8b53it29hfhj******'),
  podMetrics?: [ 
    {
      metrics?: [ 
        {
          time?: string(name='Time', example='1669107528450'),
          value?: string(name='Value', example='4.536552540058814'),
        }
      ](name='Metrics'),
      podId?: string(name='PodId', description='Pod ID。', example='eais-hznzre6ffmz9num4****-579b587ddf-9txr6'),
    }
  ](name='PodMetrics'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3****'),
}

model GetInstanceMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceMetricsResponseBody(name='body'),
}

/**
 * @summary 获取EAIS实例级别的监控数据
 *
 * @param request GetInstanceMetricsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceMetricsResponse
 */
async function getInstanceMetricsWithOptions(request: GetInstanceMetricsRequest, runtime: $RuntimeOptions): GetInstanceMetricsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.timeStep)) {
    query['TimeStep'] = request.timeStep;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInstanceMetrics',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取EAIS实例级别的监控数据
 *
 * @param request GetInstanceMetricsRequest
 * @return GetInstanceMetricsResponse
 */
async function getInstanceMetrics(request: GetInstanceMetricsRequest): GetInstanceMetricsResponse {
  var runtime = new $RuntimeOptions{};
  return getInstanceMetricsWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a4884'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='instance'),
  tag?: [ 
    {
      key?: string(name='Key', example='TestKey'),
      value?: string(name='Value', example='TestValue'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a4885'),
  requestId?: string(name='RequestId', example='F23AEEC7-4D98-4657-A104-02692701****'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', example='eais-hzs4h26yyt5xkcke****'),
      resourceType?: string(name='ResourceType', example='instance'),
      tagKey?: string(name='TagKey', example='TestKey'),
      tagValue?: string(name='TagValue', example='TestValue'),
    }
  ](name='TagResources'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary 查询标签列表
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询标签列表
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model StartEaiJupyterRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='eais-hze3x2gv9wimdj0k****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model StartEaiJupyterResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', example='eais:StartEaiJupyter'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', example='20560152949032****'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', example='170718266783****'),
    authPrincipalType?: string(name='AuthPrincipalType', example='SubUser'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', example='AQFmfh3BZn4dwUQyNzY4MDVELTgzQkUtNTBEOC04QjQyLTNGM0U1QUI5MjhBRA=='),
    noPermissionType?: string(name='NoPermissionType', example='ExplicitDeny'),
    policyType?: string(name='PolicyType', example='AccountLevelIdentityBasedPolicy'),
  }(name='AccessDeniedDetail'),
  requestId?: string(name='RequestId', example='04DEB304-2436-4CB9-BB63-468BCEA0****'),
}

model StartEaiJupyterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartEaiJupyterResponseBody(name='body'),
}

/**
 * @summary 启动一个部署了notebook的弹性加速计算实例
 *
 * @param request StartEaiJupyterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartEaiJupyterResponse
 */
async function startEaiJupyterWithOptions(request: StartEaiJupyterRequest, runtime: $RuntimeOptions): StartEaiJupyterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartEaiJupyter',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 启动一个部署了notebook的弹性加速计算实例
 *
 * @param request StartEaiJupyterRequest
 * @return StartEaiJupyterResponse
 */
async function startEaiJupyter(request: StartEaiJupyterRequest): StartEaiJupyterResponse {
  var runtime = new $RuntimeOptions{};
  return startEaiJupyterWithOptions(request, runtime);
}

model StartEaisEiRequest {
  eiInstanceId?: string(name='EiInstanceId', description='This parameter is required.', example='eais-hzu00xufs1c8j5nn****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model StartEaisEiResponseBody = {
  requestId?: string(name='RequestId', example='F23AEEC7-4D98-4657-A104-02692701****'),
}

model StartEaisEiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartEaisEiResponseBody(name='body'),
}

/**
 * @summary 启动一个弹性加速计算实例
 *
 * @param request StartEaisEiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartEaisEiResponse
 */
async function startEaisEiWithOptions(request: StartEaisEiRequest, runtime: $RuntimeOptions): StartEaisEiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.eiInstanceId)) {
    query['EiInstanceId'] = request.eiInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartEaisEi',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 启动一个弹性加速计算实例
 *
 * @param request StartEaisEiRequest
 * @return StartEaisEiResponse
 */
async function startEaisEi(request: StartEaisEiRequest): StartEaisEiResponse {
  var runtime = new $RuntimeOptions{};
  return startEaisEiWithOptions(request, runtime);
}

model StopEaiJupyterRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='eais-hze3x2gv9wimdj0k****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model StopEaiJupyterResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', example='eais:StopEaiJupyter'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', example='20560152949032****'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', example='170718266783****'),
    authPrincipalType?: string(name='AuthPrincipalType', example='SubUser'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', example='AQFmj0FOZo9BTjMyQTFDRkIzLUE5MTItNUIwNC1BQzkxLTcyMUFFQTUyQjhGQQ=='),
    noPermissionType?: string(name='NoPermissionType', example='ExplicitDeny'),
    policyType?: string(name='PolicyType', example='AccountLevelIdentityBasedPolicy'),
  }(name='AccessDeniedDetail'),
  requestId?: string(name='RequestId', example='F5FEB9AA-C108-577C-AB3D-D13524AF****'),
}

model StopEaiJupyterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopEaiJupyterResponseBody(name='body'),
}

/**
 * @summary 停止一个部署了notebook的弹性加速计算实例
 *
 * @param request StopEaiJupyterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopEaiJupyterResponse
 */
async function stopEaiJupyterWithOptions(request: StopEaiJupyterRequest, runtime: $RuntimeOptions): StopEaiJupyterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopEaiJupyter',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 停止一个部署了notebook的弹性加速计算实例
 *
 * @param request StopEaiJupyterRequest
 * @return StopEaiJupyterResponse
 */
async function stopEaiJupyter(request: StopEaiJupyterRequest): StopEaiJupyterResponse {
  var runtime = new $RuntimeOptions{};
  return stopEaiJupyterWithOptions(request, runtime);
}

model StopEaisEiRequest {
  eiInstanceId?: string(name='EiInstanceId', description='This parameter is required.', example='eais-hzu00xufs1c8j5nn****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model StopEaisEiResponseBody = {
  requestId?: string(name='RequestId', example='F23AEEC7-4D98-4657-A104-02692701****'),
}

model StopEaisEiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopEaisEiResponseBody(name='body'),
}

/**
 * @summary 停止一个弹性加速计算实例
 *
 * @param request StopEaisEiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopEaisEiResponse
 */
async function stopEaisEiWithOptions(request: StopEaisEiRequest, runtime: $RuntimeOptions): StopEaisEiResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.eiInstanceId)) {
    query['EiInstanceId'] = request.eiInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopEaisEi',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 停止一个弹性加速计算实例
 *
 * @param request StopEaisEiRequest
 * @return StopEaisEiResponse
 */
async function stopEaisEi(request: StopEaisEiRequest): StopEaisEiResponse {
  var runtime = new $RuntimeOptions{};
  return stopEaisEiWithOptions(request, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='instance'),
  tag?: [ 
    {
      key?: string(name='Key', example='TestKey'),
      value?: string(name='Value', example='TestValue'),
    }
  ](name='Tag', description='This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary 为弹性加速计算实例创建并绑定标签
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 为弹性加速计算实例创建并绑定标签
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', example='false'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='instance'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', example='1E23D585-BBD8-436F-9615-54CACD67****'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary 解绑并删除标签
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2019-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 解绑并删除标签
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

